<?php
/**
 * Created by PhpStorm.
 * User: liyu
 * Date: 2018/4/8
 * Time: 下午4:44
 */

namespace app\common\controller;


class Rand
{
    /**
     * 创建随机数(最大12位)
     * @param int $num  随机数位数
     * @return string
     */
    static public function createRandNum($num=8){
        return substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, $num);
    }
}